<template>
  <div>
    <Verify ref="verify" @success="success" :mode="mode" :captchaType="captchaType" :imgSize="imgSize"/>
  </div>
</template>

<script>
  //引入组件
  import Verify from "@/components/verifition";
  export default {
    name: "PictureCaptcha",
    components: {
      Verify,
    },
    data() {
      return {
        time: 60,
        imgSize:{
          width: '350px',
          height: '165px' ,
        },
        // mode: 'mask',
        mode: 'pop',
        captchaType:'',
        captchaParams: null
      }
    },
    methods: {
      refreshCode(captchaType){
        this.captchaParams = null;
        this.captchaType = captchaType;
        this.$refs.verify.refresh();
      },
      success(params) {
        this.captchaParams = params;
        this.$emit("success", params)
      },
      valid(){
        if(!this.captchaParams){
          this.$refs.verify.show();
          return this.codeError = ' ';
        }
        return '';
      },
      getCaptchaInfo(){
        return this.captchaParams;
      },
    }
  };
</script>

<style>
</style>
